set command to "gs -dCompatibilityLevel=1.2 -dMaxSubsetPct=100 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=" & outfile & space & "-c save pop -f" & space & infile
with timeout of 300 seconds
tell application "ps2pdf"
activate
set status to (exec command in the folder alias working_directory)
if status = 0 then
tell application "Finder"
set creator type of file (working_directory & outfile) to "CARO"
set file type of file (working_directory & outfile) to "PDF "